package com.westos.userauth.dao.mybatis;

import com.westos.userauth.domain.PartyRelationship;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

/**
 * 卢梓浩
 */
@Mapper
public interface PartyRelationshipDAO {
    //创建party之间的关系

    int insertPartyRelationship(@Param("partyRelationship") PartyRelationship partyRelationship,
                                @Param("relationshipName") String relationshipName);

    //修改party之间的关系
    int updatePartyRelationship(PartyRelationship partyRelationship);

    // 删除party的关系   改
    int deletePartyRelationship(Date fromDate);

    // 创建party的关系和角色    改
    int insertPartyRelationshipAndRole(@Param("roleTypeId") String roleTypeId,
                                       @Param("relationshipName") String relationshipName,
                                       @Param("fromDate") Date fromDate);

    //创建关系类型
    int insertPartyRelationshipType(String partyRelationshipTypeId);

    // 创建party的关系和角色   改
    int insertUpdatePartyRelationshipAndRoles(@Param("roleTypeId") String roleTypeId,
                                              @Param("relationshipName") String relationshipName,
                                              @Param("fromDate") Date fromDate);
    //更新    改
    int UpdatePartyRelationshipAndRoles(Date thurDate);

    //根据id查询PartyRelationship
    PartyRelationship queryById(String partyIdFrom);
}
